package mysql

import (
	"database/sql"
	"fmt"
	"os"

	_ "github.com/go-sql-driver/mysql"
)

var db *sql.DB

func init() {
	db, _ = sql.Open("mysql", "root:123456@tcp(111.229.160.199:3306)/filestore?charset=utf8")
	db.SetMaxIdleConns(1000)
	err := db.Ping() // 连接测试
	if err != nil {
		fmt.Println("Failed to connect to mysql,err:" + err.Error())
		os.Exit(1)
	}
}

// 返回连接对象
func DBConn() *sql.DB {
	return db
}

// func ParseRows()
